import request from '@/utils/request'

// 查询仪表管理列表
export function listYibiao(query) {
  return request({
    url: '/yibiaoManagement/yibiao/list',
    method: 'get',
    params: query
  })
}

// 查询仪表管理详细
export function getYibiao(ybId) {
  return request({
    url: '/yibiaoManagement/yibiao/' + ybId,
    method: 'get'
  })
}

// 新增仪表管理
export function addYibiao(data) {
  return request({
    url: '/yibiaoManagement/yibiao',
    method: 'post',
    data: data
  })
}

// 修改仪表管理
export function updateYibiao(data) {
  return request({
    url: '/yibiaoManagement/yibiao',
    method: 'put',
    data: data
  })
}

// 删除仪表管理
export function delYibiao(ybId) {
  return request({
    url: '/yibiaoManagement/yibiao/' + ybId,
    method: 'delete'
  })
}

//----------------------------------
// 查询所有小区信息
export function listCommunity() {
  return request({
    url: '/yibiaoManagement/yibiao/communitylist',
    method: 'get',
    params:''
  })
}
//修改仪表状态
export function setStatus(ybId) {
  return request({
    url: '/yibiaoManagement/yibiao/editStatus/' + ybId,
    method: 'put'
  })
}
//查询所有的仪表类型
export function listTypes() {
  return request({
    url: '/yibiaoManagement/yibiao/typelist',
    method: 'get'
  })
}

//抄表
export function chaobiao(ybId) {
  return request({
    url: '/yibiaoManagement/yibiao/chaobiao/' + ybId,
    method: 'put'
  })
}
